<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;


Route::any('wechat/serve', 'wechat.WechatController/serve');//公众号服务


// 不需要登录
Route::group(function () {
    // 小程序登录
    // Route::post("login","wechat.AppletsController/toLogin")->name('login');

    //用户授权
    Route::get("auth","wechat.WechatController/auth");


    //首页
    Route::get("index","Index/index");

    //网站配置
    Route::get("website","Index/website");

    //获取问题
    Route::get("question","Index/getQuestion");


    //获取验证码
    Route::get("moblie/verify","AuthController/verify");

    //登录
    Route::post("moblie/login","AuthController/molibe");

    //地址
    Route::get("map","Index/getMap");

    //通过code获取用户信息
    Route::get("wechat/code","wechat.WechatController/tologin");
     
})->middleware(\learn\middleware\AllowOriginMiddleware::class);




//需要登录的
Route::group(function () {

    //注册微信信息
    Route::post("wechat/login","wechat.WechatController/goLogin");

    //用户信息
    Route::post("user/info","user.UserController/info");
    
    //个人中心
    Route::post("user/index","user.UserController/personal");

    //保存用户信息
    Route::post("user/submit","user.UserController/submit");

    //用户收藏列表
    Route::post("collection/list","user.UserController/CollectionList");

    //用户创建收藏
    Route::post("collection/create","user.UserController/Collection");

    //用户浏览列表
    Route::post("browse/list","user.UserController/browseList");

    //用户添加浏览记录
    Route::post("browse/create","user.UserController/createBrowse");

    //设置用户信息的前提
    Route::post("premise","Index/premise");

    //签到
    Route::post("welfare/sign","welfare.IndexController/sign");
    
    //福利社信息
    Route::post("welfare/index",'welfare.IndexController/index');

    //签到详情
    Route::post("welfare/signinfo","welfare.IndexController/signInfo");

    //上传文件
    Route::post("uploadfile","Index/savefile");


    //产品列表
    Route::post("product/list",'product.Product/index');
    
    
    //推荐产品
    Route::post("product/recommend",'product.Product/recommend');


    //产品详情
    Route::post("product/info","product.Product/productInfo");

    //消息列表
    Route::post("news/list","Index/newList");

    //金币明细
    Route::post("user/goldinfo","user.UserController/goldInfo");
    
})->middleware(\learn\middleware\AllowOriginMiddleware::class)->middleware(\learn\middleware\AuthTokenMiddleware::class, true);


